﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Common.UI.EM.Views.Interfaces;

namespace Common.UI.EM
{
    /// <summary>
    /// Interaction logic for EntityManagerView.xaml
    /// </summary>
    public partial class EntityManagerView : UserControl, IEntityManagerView
    {
        public EntityManagerView(IFilterView filterView, IListView listView, IDetailView detailView)
        {
            InitializeComponent();

            this.filterContentControl.Content = filterView;
            this.listContentControl.Content = listView;
            this.detailContentControl.Content = detailView;
        }

        
        public void ShowFilter()
        {
            this.filterExpander.IsExpanded = true;
            this.listExpander.IsExpanded = true;
            this.detailExpander.IsExpanded = false;
            this.detailExpander.IsEnabled = false;
        }

        public void ShowList()
        {
            this.filterExpander.IsExpanded = true;
            this.listExpander.IsExpanded = true;

            this.detailExpander.IsExpanded = false;
            this.detailExpander.IsEnabled = false;
        }

        public void ShowDetail()
        {
            this.filterExpander.IsExpanded = false;
            this.listExpander.IsExpanded = false;

            this.detailExpander.IsEnabled = true;
            this.detailExpander.IsExpanded = true;
        }

    }
}
